package cn.sofwin.blog.service.impl;

import cn.sofwin.blog.service.ArticleCommentService;
import cn.sofwin.blog.utils.DbUtils;
import org.apache.ibatis.session.SqlSession;

/**
 * 服务层
 * @author LetCode
 * @since 1.0
 *
 */
public class ArticleCommentServiceImpl implements ArticleCommentService {

    /** 私有的实例对象，用户实现单例模式 */
    private static ArticleCommentServiceImpl articleCommentService = new ArticleCommentServiceImpl();

    /**
     * 将构造方法设为私有，用于实现单例模式
     */
    private ArticleCommentServiceImpl(){
        super();
    }

    /**
     * 对外提供的静态方法，用于获取服务实例
     * @return
     */
    public static ArticleCommentService getInstance(){
        return articleCommentService;
    }

    @Override
    public SqlSession getSession() {
        return DbUtils.openSession();
    }

}